<!--信号Cell-Vtrading-->
<template>
  <div class="cell bg2">

    <div class="cell-info bk3">

      <LImage class="texture2" :src="Config.img('texture2.png')" />
      <div class="row">
        <LImage class="img-logo" :src="Config.img('jiagejingbao.png')" />
        <text class="font32 fontz text1">{{item.signalName}}</text>
      </div>
      <div class="line bg3"></div>

      <div class="row">
        <text class="font26 text2" v-if="item.type=='spot'">{{item.exchangeName+'（'+item.counterCoin+'/'+item.baseCoin+'）'}}</text>
        <text class="font26 text2" v-else>{{item.exchangeName+'（'+item.counterCoin+' '+T('永续')+'/'+item.baseCoin+'）'}}</text>
      </div>
      <div class="height20"></div>

      <div class="row acenter">
        <text class="font22 text2">{{T('创建时间：')}}</text>
        <div class="width10"></div>
        <text class="font28 text1 all">{{item.createTimeStr}}</text>

        <div class="but main1" :class="[item.statesBol ? 'but-no' : '']"  @click="upClick">
          <text class="font22 fontz text1">{{T('启动')}}</text>
        </div>
      </div>

      <div class="height20"></div>
      <div class="row acenter">
        <text class="font22 text2">{{T('信号类型：')}}</text>
        <div class="width10"></div>
        <text class="font28 text1 all">{{T('价格警报')}}</text>


        <div class="but warning1" :class="[!item.statesBol ? 'but-no' : '']"  @click="endClick">
          <text class="font22 fontz text1">{{T('停止')}}</text>
        </div>
      </div>

      <div class="but-close" @click="funcClick($event)">
        <LImage class="img-genduo" :src="Config.img('v2_gengduox.png')" />
      </div>
    </div>

    <div  v-if="item.SignalContentStr" class="cell-msg">
      <text class="font26 text3">{{item.SignalTimeStr}}</text>
      <div class="height10"></div>
      <text class="font28 text2">{{item.SignalContentStr}}</text>
    </div>
  </div>
</template>

<script>
import jconfig from "@/_js/config";

const weexFunction = weex.requireModule('WeexFunction');
import I18N from "@/_i18n/i18n";
var T = I18N.t;
export default {

  props:{

    item:{
      type: Object,
      default:undefined,
    }
  },

  data() {
    return {
      T:T,
      Config:jconfig,
    };
  },

  mounted() {
  },
  
  
  computed: {

    //交易所对象
    exchangeMap() {
      var exchangeMap = this.exchanges[this.exchange];
      return exchangeMap;
    },

    //当前配置
    paramMap() {
      var param = this.params[this.param];
      return param;
    }
  },
  methods: {
   
    /********************************** 点击*/
    //功能
    funcClick(event) {
      this.$emit('func', event);
    },

    //启动
    upClick() {
      if (this.item.statesBol) return;
      this.$emit('up');
    },

    //停止
    endClick() {
      if (!this.item.statesBol) return;
      this.$emit('end');
    }
  }
}
</script>

<style src="@/_css/style.css" ></style>
<style scoped>
.cell {
  overflow: hidden;
}
.cell-info {
  padding: 40px;
  border-radius: 16px;
  border-width: 2px;
}
.cell-msg {
  padding: 20px 40px;
}
.but-close {
  z-index: 9;
  position: absolute;
  align-items: center;
  justify-content: center;
  top: 15px;
  right: 15px;
  width: 62px;
  height: 62px;
}
.img-genduo {
  width: 32px;
  height: 32px;
}
.img-logo {
  width: 50px;
  height: 50px;
  margin-right: 30px;
}
.line {
  height: 1px;
  margin-top: 30px;
  margin-bottom: 30px;
}
.but {
  align-items: center;
  justify-content: center;
  width: 110px;
  height: 44px;
  border-radius: 6px;
  margin-left: 10px;
  opacity: 1; 
}
.but-no {
  opacity: 0.5; 
}
</style>